package com.itheima.leetcode.od.c.logicalsimulation;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

/**
 * <h3>免单统计</h3>
 */
public class FreeOrderStatistics {
    // 输入获取
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.nextLine());

        String[] arr = new String[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextLine();
        }

        System.out.println(getResult(arr));
    }

    // 算法入口
    public static int getResult(String[] arr) {
        Arrays.sort(arr);

        LinkedList<String> stack = new LinkedList<>();
        stack.add(arr[0]);

        int i = 1;
        while (i < arr.length) {
            String time = arr[i++];
            String top = stack.getLast();

            if (top.equals(time) || !top.substring(0, 19).equals(time.substring(0, 19))) {
                stack.add(time);
            }
        }

        return stack.size();
    }
}